# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=nfpm
pkgver=2.35.1
pkgrel=0
pkgdesc="a simple apk, Deb and RPM packager without external dependencies"
url="https://nfpm.goreleaser.com/"
arch="all !riscv64"
license="MIT"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/goreleaser/nfpm/archive/v$pkgver.tar.gz"

export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -ldflags "-X main.version=$pkgver" -v -o nfpm ./cmd/nfpm/main.go
}

check() {
	go test
}

package() {
	install -Dm0755 nfpm "$pkgdir/usr/bin/nfpm"
}

sha512sums="
543674f765fe9b56bf5588195f40428c4ace7e18c61375284eb5d57b7ffeea0f9de07885d762540a32291f99219ed84f79c1c43a4b6d0f0968b50477c227683e  nfpm-2.35.1.tar.gz
"
